import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { LifestyleUpgradeInfo } from "./info/LifestyleUpgradeInfo";
type int = number;
//class LifestyleUpgradeConfig
    
    export  class LifestyleUpgradeConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (LifestyleUpgradeConfig._instance != null) 
            {
                throw new Error(" LifestyleUpgradeConfig 单例 ");
            }
            LifestyleUpgradeConfig._instance = this;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_lifestyle_upgrade.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new LifestyleUpgradeInfo();
                loc1.color = loc2.color;
                loc1.jsStr = loc2.jsStr;
                this._map[loc1.color] = loc1;
            }
            return;
        }

        public getUpgradeInfo(arg1: int): LifestyleUpgradeInfo
        {
            return this._map[arg1];
        }

        public static get instance(): LifestyleUpgradeConfig
        {
            if (LifestyleUpgradeConfig._instance == null) 
            {
                LifestyleUpgradeConfig._instance = new LifestyleUpgradeConfig();
            }
            return LifestyleUpgradeConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: LifestyleUpgradeConfig;
    }
